// 约定一个通用的键名
const CHANNEL_NO = 'channel_no'
const HREF = 'href'
const LONGITUDE = 'longitude'
const MAINADRESS = 'mainadress'
const SUBMITDATA = 'submitdata'
// 获取渠道号
export const getchannelno = () => {
  const dafaul = ''
  const result = localStorage.getItem(CHANNEL_NO)
  return result ? result : dafaul
}

// 设置渠道号
export const setchannelno = (val) => {
  localStorage.setItem(CHANNEL_NO,val)
}

// 获取首页地址
export const gethref = () => {
  const dafaul = ''
  const result = localStorage.getItem(HREF)
  return result ? result : dafaul
}
// 设置首页地址
export const sethref = (val) => {
  localStorage.setItem(HREF,val)
}
// 获取经纬度
export const getlongit = () => {
  const defaultObj = {}
  const result = localStorage.getItem(LONGITUDE)
  return result ? JSON.parse(result) : defaultObj
}
// 设置经纬度
export const setlongit = (obj) => {
  localStorage.setItem(LONGITUDE, JSON.stringify(obj))
}
// 获取逆地理地址
export const getmainadress = () => {
  const defaultObj = {}
  const result = localStorage.getItem(MAINADRESS)
  return result ? JSON.parse(result) : defaultObj
}
// 设置j金纬度
export const setmainadress = (obj) => {
  localStorage.setItem(MAINADRESS, JSON.stringify(obj))
}
// 获取经纬度
export const getsubmitdata = () => {
  const defaultObj = {}
  const result = localStorage.getItem(SUBMITDATA)
  return result ? JSON.parse(result) : defaultObj
}
// 设置j金纬度
export const setsubmitdata = (obj) => {
  localStorage.setItem(SUBMITDATA, JSON.stringify(obj))
}
